import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        int cnt=0;
        while(cnt<t){
            int[] arr=new int[6];
            for(int i=0;i<6;i++){
                arr[i]=sc.nextInt();
            }
            Arrays.sort(arr);
            int left=0;
            int right=4;
            int[] ar=new int[3];
            for(int i=5;i>=2;i--){
                while(left!=right){
                    if(arr[left]+arr[right]<=arr[i]){
                        left++;
                    }else{
                        ar[0]=left;
                        ar[1]=right;
                        ar[2]=i;
                        break;
                    }
                }
                if(ar[2]!=0){
                    break;
                }
            }
            int num=0,sum=0;
            for(int i=0;i<6;i++){
                if(i!=ar[0]&&i!=ar[1]&&i!=ar[2]){
                    if(num<2){
                        sum+=arr[i];
                        num++;
                    }else{
                        sum-=arr[i];
                    }
                }
            }
            if(sum>0){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
            cnt++;
        }
    }
    public static void main3(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        char[] ch=str.toCharArray();
        int n=ch.length;
        StringBuilder ret=new StringBuilder();
        int max=0,pos=0;
        for(int i=0;i<n;i++){
            int count=0;
            while(ch[i]>='0'&&ch[i]<='9'){
                count++;
                i++;
                if(i==n){
                    break;
                }
            }
            if(max<count){
                max=count;
                pos=i-count;
            }
        }
        for(int i=pos;i<pos+max;i++){
            ret.append(ch[i]);
        }
        System.out.println(ret.toString());
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt();
        Set<Integer> set=new HashSet<>();
        for(int i=a;i<=b;i++){
            if(isHappy(i)) {
                set.add(i);
            }
        }
        if(set.isEmpty()){
            System.out.println("SAD");
        }else{
            for(int i=a;i<=b;i++){
                if(set.contains(i)){
                    boolean flg=true;
                    int count=0;
                    int slow=i;
                    int fast=func(i);
                    while(slow!=fast){
                        slow=func(slow);
                        fast=func(func(fast));
                        if(set.contains(slow)){
                            flg=false;
                            break;
                        }
                        count++;
                    }
                    if(flg){
                        if(isNum(i)){
                            count*=2;
                        }
                        System.out.println(i+" "+count);
                    }
                }
            }
        }
    }
    public static boolean isHappy(int n){
        int slow=n;
        int fast=func(n);
        while(slow!=fast){
            slow=func(slow);
            fast=func(func(fast));
        }
        return slow==1;
    }
    public static int func(int n){
        int sum=0;
        while(n!=0){
            int t=n%10;
            sum+=t*t;
            n/=10;
        }
        return sum;
    }
    public static boolean isNum(int n){
        boolean flg=true;
        for(int i=2;i<Math.sqrt((double)n);i++){
            if(n%i==0){
                flg=false;
                break;
            }
        }
        return flg;
    }
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n=scan.nextInt();
        int[][] arr=new int[n][3];
        int sum=0;
        for(int i=0;i<n;i++){
            arr[i][0]=scan.nextInt();
            arr[i][1]=scan.nextInt();
            arr[i][2]=arr[i][0]-arr[i][1];
        }
        Arrays.sort(arr,(a,b)->b[2]-a[2]);
        for(int i=0;i<n/2;i++){
            sum+=arr[i][0];
        }
        for(int i=n/2;i<n;i++){
            sum+=arr[i][1];
        }
        System.out.println(sum);
        scan.close();
    }
}